package com.example.myapplication.util;

import android.app.Application;

import com.example.myapplication.MyEventBusIndex;
import com.example.myapplication.server.DemoIntentService;
import com.example.myapplication.server.DemoPushService;
import com.igexin.sdk.PushManager;

import org.greenrobot.eventbus.EventBus;

public class BaseApplication extends Application {
    private static BaseApplication mContext;

    private static BaseApplication getInstance() {
        return mContext;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        EventBus.builder().addIndex(new MyEventBusIndex()).installDefaultEventBus();
        mContext = this;
        AppUtils.setApplication(this);
        PushManager.getInstance().initialize(getApplicationContext(), DemoPushService.class);
        PushManager.getInstance().registerPushIntentService(getApplicationContext(), DemoIntentService.class);

    }
}
